using System;
using Sedge.Core.Configuration;
using Sedge.Core.Execution;
using Sedge.Core.Execution.ReportElements;
using Sedge.Core.Globalization;
using Sedge.Core.Utils;

namespace Sedge.UI.ViewModel
{
	public class TrackingInfoViewModel
	{
		private readonly Suite _suite;

		public TrackingInfoViewModel(Suite suite)
		{
			_suite = suite;
		}

		public void StoreData(string feature, string story, string iteration, string contact, string[] notes)
		{
			ReportTable reportTable = new ReportTable(_suite);
			reportTable.AddRow(Locale.TemplateStrings.TrackingInfoFeature, feature);
			reportTable.AddRow(Locale.TemplateStrings.TrackingInfoStory, story);
			reportTable.AddRow(Locale.TemplateStrings.TrackingInfoIteration, iteration);
			reportTable.AddRow(Locale.TemplateStrings.TrackingInfoDate,
				String.Format("{0} {1}", DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString()));
			reportTable.AddRow(Locale.TemplateStrings.TrackingInfoContact, contact);
			reportTable.AddRow(Locale.TemplateStrings.TrackingInfoNotes, HtmlHelper.ArrayToBreakedString(notes));
			_suite.TempData[TempDataKeys.TrackingInfo] = reportTable;
		}
	}
}